**# Bookmark #1 Setting

*Windows
global root  = "G:/Dropbox/Environmental Injustice/Empirical"
global rawdata = "$root/rawdata"
global workdata = "$root/workdata"
global results = "$root/results"
global outfile = "$root/outfile"

cd "$workdata"


**# Bookmark #2 City-level

use "$outfile/City_regression.dta",clear

xtset city year

xtbalance, range(2001 2010)

gen interaction=(100-belowcl)*post

egen prov_year=group(province year)

quietly do "$workdata/did_continuous_nostayers.ado"

did_continuous_nostayers codemission city prov_year interaction if inlist(year, 2005, 2010)


use "$outfile/City_regression.dta",clear

xtset city year

xtbalance, range(2001 2010)

gen interaction=(100-belowhs)*post

egen prov_year=group(province year)

quietly do "$workdata/did_continuous_nostayers.ado"

did_continuous_nostayers codemission city prov_year interaction if inlist(year, 2005, 2010)

**# Bookmark #3 Firm-level

use "$outfile/Firm_regression.dta",clear

keep if year==2005|year==2010

bys id:gen tag=_N

drop if tag==1

egen id1=group(id)

gen interaction=(100-belowcl)*post

egen prov_year=group(province year)

did_continuous_nostayers codemission id1 prov_year interaction if inlist(year, 2005, 2010)


use "$outfile/Firm_regression.dta",clear

keep if year==2005|year==2010

bys id:gen tag=_N

drop if tag==1

egen id1=group(id)

gen interaction=(100-belowhs)*post

egen prov_year=group(province year)

did_continuous_nostayers codemission id1 prov_year interaction if inlist(year, 2005, 2010)